import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:material_design_practice1/custom_widget.dart';

class Page1 extends StatefulWidget{
  @override
  State<StatefulWidget> createState() {
    return Page1State();
  }
}

class Page1State extends State{
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          elevation: 0,
          backgroundColor: Colors.transparent,
          shape: Border(bottom: BorderSide(color: Colors.black12)),
          titleSpacing: 0,
          leading: Icon(Icons.menu,color: Colors.black54,size: 28,),
          title: Text(
            "Algebra2",
            style: TextStyle(
              fontSize: 22,
              color: Colors.blue
            ),
          ),
          actions: <Widget>[
            IconButton(
              icon: Icon(Icons.portrait,color: Colors.black54, size: 28,),
              onPressed: (){},
            ),
            PopupMenuButton(
              icon: Icon(Icons.more_vert,color: Colors.black54, size: 28,),
              itemBuilder:(context) => <PopupMenuItem>[

              ],
            )
          ],
        ),
        body: SingleChildScrollView(
          child: Container(
            width: MediaQuery.of(context).size.width,
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                Container(margin: EdgeInsets.only(top: 16),),
                Container(
                  margin: EdgeInsets.all(16),
                  child: IconDataWidget(Icon(Icons.assignment,color: Colors.white,size: 32,),"Watch the Instroction to Algebra and do question", "Due Dec 16,2014,11:59 PM",Colors.blue),
                ),
                Container(
                  margin: EdgeInsets.all(16),
                  child: IconDataWidget(Icon(Icons.device_unknown,color: Colors.white,size: 32,), "Field trip survey", "Due Aug 6 2016,11:59 PM   2", Colors.grey),
                ),
                Container(
                  margin: EdgeInsets.fromLTRB(16,20,16,16),
                  child: Text("Graphing",style: TextStyle(color: Colors.blue,fontSize: 28),),
                ),
                Container(
                  margin: EdgeInsets.fromLTRB(16,0,16,0),
                  child: Divider(color: Colors.blue,thickness: 2,height: 2,),
                ),
                Container(
                  margin: EdgeInsets.all(16),
                  child: IconDataWidget(Icon(Icons.assignment,color: Colors.white,size: 32,),"Parabolas worksheet", "Due Dec 17,2018,11:59 PM",Colors.blue),
                ),
                Container(
                  margin: EdgeInsets.all(16),
                  child: IconDataWidget(Icon(Icons.assignment,color: Colors.white,size: 32,),"Graphing planets!", "Due Dec 18,2018,11:59 PM",Colors.blue),
                ),
                Container(
                  margin: EdgeInsets.fromLTRB(16,20,16,16),
                  child: Text("Videos",style: TextStyle(color: Colors.blue,fontSize: 28),),
                ),
                Container(
                  margin: EdgeInsets.fromLTRB(16,0,16,0),
                  child: Divider(color: Colors.blue,thickness: 2,height: 2,),
                ),
                Container(
                  margin: EdgeInsets.all(16),
                  child: IconDataWidget(Icon(Icons.assignment,color: Colors.white,size: 32,),"Watch video on quadratic equations", "Due Aug 3,2016,11:59 PM",Colors.grey),
                )
              ],
            ),
          ),
        ),
        bottomNavigationBar: BottomNavigationBar(
          items: const <BottomNavigationBarItem>[
            BottomNavigationBarItem(
                icon: Icon(Icons.forum, size: 28,),
                title: Text("Stream",style: TextStyle(fontSize: 16,fontWeight: FontWeight.bold),)
            ),
            BottomNavigationBarItem(
              icon: Icon(Icons.assignment, size: 28,),
              title: Text("Classwork",style: TextStyle(fontSize: 16,fontWeight: FontWeight.bold),),
            ),
            BottomNavigationBarItem(
                icon: Icon(Icons.group, size: 28,),
                title: Text("People",style: TextStyle(fontSize: 16,fontWeight: FontWeight.bold),),
            )
          ],
          currentIndex: 1,
        ),
      ),
    );
  }

}